<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateNotificationTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('notification', function (Blueprint $table) {
            $table->uuid('id')->primary();
            $table->string('type');
            $table->unsignedBigInteger('user_id',false)->default(0)->comment('用户id');
            $table->string('title',120)->nullable()->comment('标题');
            $table->text('content')->nullable()->comment('内容');
            $table->text('data')->nullable()->comment('扩展数据');
            $table->dateTime('read_at')->nullable()->comment('阅读时间');
            $table->timestamps();
            $table->softDeletes();
            $table->engine="InnoDb";
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('notification');
    }
}
